package com.varian.security.config;

import com.varian.security.handler.SecurityMetaObjectHandler;
import com.varian.security.handler.VarianMethodSecurityExpressionHandler;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;

/**
 * @author ben
 * @since 2024/6/23
 */
@AutoConfiguration
@EnableMethodSecurity
@EnableWebSecurity
public class SecurityAutoConfig {

    @Bean
    public SecurityMetaObjectHandler securityMetaObjectHandler() {
        return new SecurityMetaObjectHandler();
    }

    @Bean({"varianMethodSecurityExpressionHandler", "eh"})
    public VarianMethodSecurityExpressionHandler varianMethodSecurityExpressionHandler() {
        return new VarianMethodSecurityExpressionHandler();
    }

}
